﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CassiniDev;
using System.IO;
using System.Diagnostics;

namespace CassiniSelfHost
{
    class Program
    {
        static void Main(string[] args)
        {
            CassiniDevServer _server = new CassiniDevServer();

            //Get Root Path
            string exePath = AppDomain.CurrentDomain.BaseDirectory;
            string rootPath = exePath.Substring(0, exePath.IndexOf("\\Cassini"));

            //Cassini Parameters
            string websitePath = rootPath + "\\CineProwl.Web";
            int port = 5000;
            string host = "localhost";
            string virtualPath = "/";
            _server.StartServer(websitePath, port, virtualPath, host);

            //Display User Friendly Message
            Console.WriteLine("CineProwl: Embedded Web Server");
            Console.WriteLine("Press 'Enter' to close.");
            Console.WriteLine("Careful though, CineProwl won't work without this...");
            
            var input = Console.ReadLine();
            _server.StopServer();
        }
    }
}
